export const baseColumns = [
  {
    title: '姓名/学号/工号',
    dataIndex: 'search',
    hideInTable: true,
  },
  {
    title: '角色',
    dataIndex: 'roleList',
    hideInTable: true,
    fieldProps: {
      mode: 'multiple',
    },
    valueType: 'select',
    valueEnum: new Map([
      [1, '超级管理员'],
      [2, '学生'],
      [3, '教师'],
    ]),
  },
  {
    title: '班级',
    dataIndex: 'classList',
    hideInTable: true,
    valueType: 'select',
    fieldProps: {
      mode: 'multiple',
    },
    valueEnum: new Map([]),
  },
  {
    title: '序号',
    dataIndex: 'id',
    hideInSearch: true,
    width: 60,
    render: (text, record, index) => {
      return index + 1;
    },
  },
  {
    title: '姓名',
    dataIndex: 'name',
    hideInSearch: true,
  },
  {
    title: '学号/工号',
    dataIndex: 'js_number',
    hideInSearch: true,
  },
  {
    title: '角色',
    dataIndex: 'role',
    hideInSearch: true,
    render: (text, record) => {
      return record?.role?.length > 0
        ? record?.role?.map((item) => item['role_name']).join('，')
        : '-';
    },
  },
  {
    title: '班级',
    dataIndex: 'class',
    hideInSearch: true,
    render: (text, record) => {
      return record?.class?.length > 0
        ? record?.class?.map((item) => item['class_name']).join('，')
        : '-';
    },
  },
];
